const actions = {
    add({commit},personObj){
        commit('ADD',personObj)
    }
}

const mutations = {
    ADD(state, personObj){
        state.personList.unshift(personObj)
    }
}

const state = {
    personList:[
        {id:'001', name: '张三'}
    ]
}

const getters = {
    total(state){
        return state.personList.length
    }
}

export default {
    namespaced:true,
    actions,
    mutations,
    state,
    getters
}